package com.du.quant.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Controller
public class WebController {

    @GetMapping("/")
    public String index() {
        return "index";
    }

    @GetMapping("/stock/{code}")
    public String stockDetail(@PathVariable String code, Model model) {
        model.addAttribute("stockCode", code);
        return "stock-detail";
    }
}